﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.TaskScheduling.Migrations
{
    /// <inheritdoc />
    public partial class remove_column_StandardTestItem_taskid : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_TS_StandardTestItem_TS_StandardTestTasks_StandardTestTaskId",
                schema: "TaskScheduling",
                table: "TS_StandardTestItem");

            migrationBuilder.DropIndex(
                name: "IX_TS_StandardTestItem_StandardTestTaskId",
                schema: "TaskScheduling",
                table: "TS_StandardTestItem");

            migrationBuilder.DropColumn(
                name: "StandardTestTaskId",
                schema: "TaskScheduling",
                table: "TS_StandardTestItem");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<long>(
                name: "StandardTestTaskId",
                schema: "TaskScheduling",
                table: "TS_StandardTestItem",
                type: "bigint",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_TS_StandardTestItem_StandardTestTaskId",
                schema: "TaskScheduling",
                table: "TS_StandardTestItem",
                column: "StandardTestTaskId");

            migrationBuilder.AddForeignKey(
                name: "FK_TS_StandardTestItem_TS_StandardTestTasks_StandardTestTaskId",
                schema: "TaskScheduling",
                table: "TS_StandardTestItem",
                column: "StandardTestTaskId",
                principalSchema: "TaskScheduling",
                principalTable: "TS_StandardTestTasks",
                principalColumn: "Id");
        }
    }
}
